---
title: "Accessibility Checker Rule Help: WCAG20_Label_RefValid"
---
import "../../../styles/ToolHelp.scss"
import { CodeSnippet, Tag } from "carbon-components-react";

<div className="toolHelp">
<Row>
<Column colLg={16} colMd={8} colSm={4} className="toolHead">

### The value \"{0}\" of the `<label>` `for` attribute is not the `id` of a valid `<input>` element

<div id="locLevel"></div>

The `for` attribute must reference a non-empty, unique `id` attribute of an `<input>` element

</Column>
</Row>
<Row>
<Column colLg={11} colMd={5} colSm={4} className="toolMain">

### Why is this important?

A `label` element is attached to a specific `<input>` element through the use of the `for` attribute. When a `<label>` does not reference the corresponding unique `id` in a valid labelable `<input>` element, assistive technologies will not be able to associate the label with the element.

<div id="locSnippet"></div>

### What to do

* Set the value of the `for` attribute to the `id` value of the valid `<input>` element to be labeled. Make sure the `id` value is unique. For example:

<CodeSnippet type="multi" light={true}>&lt;label id="label2" for="ln1"&gt;Last Name&lt;/label&gt;
&lt;input type="text" name="lastname" id="ln1" value="enter last name"&gt;</CodeSnippet>

</Column>
<Column colLg={5} colMd={3} colSm={4} className="toolLeft">

### About this requirement

[IBM 1.3.1 Info and Relationships](https://www.ibm.com/able/requirements/requirements/#1_3_1)
[WCAG 2.1 technique H44](https://www.w3.org/WAI/WCAG21/Techniques/html/H44)

### Who does this affect?

* Blind people using screen readers
* People with low vision using screen readers
* People with dexterity impairment using voice control

</Column>
</Row>
</div>

export default ({ children, _frontmatter }) => (<React.Fragment>{children}</React.Fragment>)
